#Boa:Frame:Login

import wx
from tela_cadastro import *

def create(parent):
    return Login(parent)

[wxID_LOGIN, wxID_LOGINBUTTON1, wxID_LOGINSTATICBOX1, wxID_LOGINSTATICTEXT1, 
 wxID_LOGINSTATICTEXT2, wxID_LOGINTEXTCTRL1, wxID_LOGINTEXTCTRL2, 
] = [wx.NewId() for _init_ctrls in range(7)]

class Login(wx.Frame):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_LOGIN, name=u'Login', parent=prnt,
              pos=wx.Point(389, 223), size=wx.Size(283, 272),
              style=wx.DEFAULT_FRAME_STYLE, title=u'Login')
        self.SetClientSize(wx.Size(275, 238))

        self.staticBox1 = wx.StaticBox(id=wxID_LOGINSTATICBOX1, label=u'Login',
              name='staticBox1', parent=self, pos=wx.Point(16, 16),
              size=wx.Size(240, 200), style=0)

        self.staticText1 = wx.StaticText(id=wxID_LOGINSTATICTEXT1,
              label=u'Login', name='staticText1', parent=self, pos=wx.Point(64,
              64), size=wx.Size(25, 13), style=0)

        self.textCtrl1 = wx.TextCtrl(id=wxID_LOGINTEXTCTRL1, name='textCtrl1',
              parent=self, pos=wx.Point(120, 56), size=wx.Size(100, 21),
              style=0, value=u'')

        self.textCtrl2 = wx.TextCtrl(id=wxID_LOGINTEXTCTRL2, name='textCtrl2',
              parent=self, pos=wx.Point(120, 112), size=wx.Size(100, 21),
              style=0, value=u'')
        self.textCtrl2.Bind(wx.EVT_TEXT, self.OnTextCtrl2Text,
              id=wxID_LOGINTEXTCTRL2)

        self.staticText2 = wx.StaticText(id=wxID_LOGINSTATICTEXT2,
              label=u'Senha', name='staticText2', parent=self, pos=wx.Point(64,
              112), size=wx.Size(30, 13), style=0)

        self.button1 = wx.Button(id=wxID_LOGINBUTTON1, label=u'Entrar',
              name='button1', parent=self, pos=wx.Point(96, 168),
              size=wx.Size(75, 24), style=0)
        self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button,
              id=wxID_LOGINBUTTON1)

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.senhaReal = ''

    def OnTextCtrl2Text(self, event):
        senha = self.textCtrl2.GetValue()
        print senha
        if senha[0] != '*':
            
            self.senhaReal = self.senhaReal + senha[0]
            print self.senhaReal
            self.textCtrl2.SetValue('*'* len(senha))

    def OnButton1Button(self, event):
        print 'sua senha: eh: %s'%(self.senhaReal)
        menu = CadastroLivro(None)
        menu.Show()
        self.Close()
        
        
        
